<?php

/**
 * netmonitor actions.
 *
 * @package    seth
 * @subpackage netmonitor
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class netmonitorActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request)
  {
      $order=$request->getParameter('orderBy', 'Name');
      $this->getUser()->setOrderField($order);
      
      $this->checks=Doctrine_Core::getTable('CheckNetDev')->getChecksGrouped();
      foreach($this->checks as &$check){
          $check['netdev']=Doctrine_Core::getTable('NetDev')->find($check["netdev"]);
      }
      
      if ($request->isXmlHttpRequest()){
        return $this->renderPartial('netmonitor/list', array("checks"=>$this->checks));
      }
  }
  
  public function executeShow(sfWebRequest $request)
  {
     
    $this->dev=$this->getRoute()->getObject();
    $this->devChecks=$this->dev->getChecks();
      
  }
  
}
